<template>
  <t-link v-permission="['decoration:budget-programme:update']" theme="primary" @click="visible = true">
    材料分析
  </t-link>
  <t-dialog
    v-model:visible="visible"
    attach="body"
    :close-on-overlay-click="false"
    :confirm-btn="null"
    destroy-on-close
    header="材料分析"
    width="80%"
  >
    <material-analysis :programme-id="props.programmeId" />
  </t-dialog>
</template>

<script setup lang="ts">
import { ref } from 'vue';

import MaterialAnalysis from '@/pages/budget/components/MaterialAnalysis.vue';

const props = defineProps({
  programmeId: {
    type: Number,
  },
});
const visible = ref(false);
</script>
